Conversation
434a215 to
dd7ed8f
Compare
dblnz
left a comment
There was a problem hiding this comment.
LGTM! Just a few comments and questions.
src/perf.rs
Outdated
| } | ||
|
|
||
| // Check perf_event_paranoid | ||
| if let Ok(val) = fs::read_to_string("/proc/sys/kernel/perf_event_paranoid") |
There was a problem hiding this comment.
Some perf events are privileged and not accessible by default for any user
| /// Build the common `perf kvm` argument prefix used by both record and report. | ||
| fn perf_kvm_args(args: &PerfArgs, kallsyms: &Path) -> Vec<OsString> { | ||
| let mut perf_args: Vec<OsString> = vec!["kvm".into()]; | ||
| if args.host { |
There was a problem hiding this comment.
If you don't provide --guest or --host it knows to only perf the guest?
There was a problem hiding this comment.
yeah should be accurate now. The wrapper doesn't have --guest, since it's the default
| /// | ||
| /// The iterator should start with the subcommand name ("perf"), which | ||
| /// clap consumes as the binary name (argv\[0\]). | ||
| pub fn run(args: impl Iterator<Item = OsString>) -> Result<()> { |
There was a problem hiding this comment.
Have you tried stripping the debug symbols from the binary loaded in the guest, but provide the correct symbols to perf?
This would show a "realistic" load time for the hyperlight guest.
There was a problem hiding this comment.
this doesn't need debug symbols, it works with default rust release profile for example. It only needs function symbols
dd7ed8f to
daa7d56
Compare
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
daa7d56 to
d45edbc
Compare
This adds a simple wrapper around
perf kvmwhich setups necessary things for getting function name resolution in the guets